package day03_oop_code.com.itheima.d4_innerclass4;

import javax.swing.*;

public class Test3 {
    public static void main(String[] args) {
        JFrame win = new JFrame("登录一下");
        JPanel panel = new JPanel();
        win.add(panel);

        JButton btn = new JButton("登录");
        panel.add(btn);

        win.setSize(400, 300);
        win.setLocationRelativeTo(null);
        win.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        win.setVisible(true);

        btn.addActionListener(e -> {
            JOptionPane.showMessageDialog(win, "登录成功");
        });
    }
}
